package cn.iocoder.yudao.module.blog.dal.mysql.manager;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.blog.dal.dataobject.manager.BlogManagerDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.blog.controller.admin.manager.vo.*;

/**
 * 论坛管理员名单 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface BlogManagerMapper extends BaseMapperX<BlogManagerDO> {

    default PageResult<BlogManagerDO> selectPage(BlogManagerPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BlogManagerDO>()
                .eqIfPresent(BlogManagerDO::getMobile, reqVO.getMobile())
                .betweenIfPresent(BlogManagerDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlogManagerDO::getId));
    }

    default List<BlogManagerDO> selectList(BlogManagerExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BlogManagerDO>()
                .eqIfPresent(BlogManagerDO::getMobile, reqVO.getMobile())
                .betweenIfPresent(BlogManagerDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlogManagerDO::getId));
    }

}
